package org.elsfs.cloud.common.mybatis.ext.sql.support.limit;

import lombok.RequiredArgsConstructor;

/**
 * 标准限制数量实现
 *

 */
@RequiredArgsConstructor
public class StandardLimitItem implements LimitItem {

    /**
     * 限制数量
     */
    private final long number;

    /**
     * 构建SQL片段
     *
     * @return SQL片段
     */
    @Override
    public String buildSqlFragment() {
        return String.format(
            "LIMIT %s",
            this.number
        );
    }
}
